<template>
  <view class="complaint">
    <view class="tit">
      举报原因(课程)
    </view>
    <u--input
        placeholder="请输入内容"
        border="surround"
        v-model="form.reasonType"
    ></u--input>
    <view class="tit" style="margin-top: 40rpx">
      举报描述
    </view>
    <u--textarea v-model="form.reasonText" placeholder="请输入内容" count ></u--textarea>
    <view class="logOut" @click="submit">提交</view>
  </view>
</template>

<script>
import {postReport} from "../../api/new";

export default {
  name: "report",
  data(){
    return{
      form:{
        targetId:undefined,
        reasonType:'',
        reasonText:''
      }
    }
  },
  onLoad(options) {
    this.form.targetId = options.id
    console.log(options)
  },
  methods:{
    submit(){
      postReport(this.form).then(res=>{
        console.log(res)
        uni.showToast({
          title: '举报成功！',
          icon: 'success',
        });
        uni.navigateBack()
      })
    }
  }
}
</script>

<style scoped lang="scss">
.complaint{
  padding: 15px;

  .tit{
    color: #8B5E3C;
    margin-bottom: 20rpx;
    font-size: 24rpx;
  }

  .logOut {
    font-size: 32rpx;
    text-align: center;
    width: 690rpx;
    height: 90rpx;
    border-radius: 45rpx;
    margin: 0 auto;
    background-color: #8B5E3C;
    line-height: 90rpx;
    color: white;
    position: absolute;
    bottom: 15px;
  }

  /deep/ .u-input{
    background-color: white !important;
  }
}
</style>